<?php

namespace app\admin\controller\project;

use app\common\controller\Backend;

/**
 * 项目类型管理
 *
 * @icon fa fa-circle-o
 */
class Type extends Backend
{

    /**
     * Type模型对象
     * @var \app\admin\model\project\Type
     */
    protected $model = null;

    public function _initialize()
    {
        parent::_initialize();
        $this->model = new \app\admin\model\project\Type;
        $uGroups = $this->auth->getGroups();
        $rules = 0;
        foreach ($uGroups as $uGroup) {
            $declaration = config('site.declaration_authority');
            if($uGroup['group_id'] == $declaration['supertube'] || $uGroup['group_id'] == $declaration['declarant']) {
                $rules = 1;
            }
        }
        $this->assignconfig('rules', $rules);
    }
}
